package org.jsets.fastboot.oss.model.entity;

import java.io.Serializable;
import java.util.Date;
import org.javers.core.metamodel.annotation.Id;
import org.jsets.fastboot.persistent.annotation.FieldFill;
import org.jsets.fastboot.persistent.enums.SqlAction;
import org.springframework.format.annotation.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

@Data
@ToString
@TableName("sys_oss_bucket")
@ApiModel(description = "文件桶")
public class Bucket implements Serializable{

	private static final long serialVersionUID = 1L;
	
	@Id
	@JsonSerialize(using = ToStringSerializer.class)
	@ApiModelProperty(value = "主键")
	private Long id;
	
	private String storageId;
	
	private String name;
	
	private String excludeType;
	
	private Boolean noticeable;
	
	private String remark;
	
	@FieldFill(when = SqlAction.INSERT)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	
	//=============== 非持久化 ===============
	@TableField(exist = false)
	private Long fileCount;
	
	@TableField(exist = false)
	private String storageName;
}
